<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>ajaxIndex</title>
    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <style>
        ul{
            width: 200px;
            height: 400px;
            border:2px solid darkturquoise;
        }
    </style>
</head>
<body>
    <ul id="ul1"></ul>
    <button id="btn">按钮</button>
    <script>
        $("#btn").on("click",function () {
            $.get("http://192.168.177.100:7001/user",function (result){
                for(var item of result){
                  $("#ul1").append("<li>"+item.title+"</li>");
                };
            }).ajaxError(function(){
                alert("An error occurred!");
            });
//            $.get("http://192.168.177.100:7001/user",{name:$("#namevalue").val()},function(data){
//                {name:$("#namevalue").val()}      //给服务器传输数据
//            })
        });
    </script>
</body>
</html>